package easy;

import java.util.HashMap;
import java.util.Map;

public class Solution_1897 {

    public boolean makeEqual(String[] words) {
        Map<Character, Integer> map = new HashMap<>();
        for (String word : words) {
            for (int i = 0; i < word.length(); i++) {
                char c = word.charAt(i);
                Integer count = map.getOrDefault(c, 0);
                map.put(c, ++count);
            }
        }
        for (Character character : map.keySet()) {
            if (map.get(character) % words.length != 0) {
                return false;
            }
        }
        return true;
    }
}
